﻿using FreeRedis;
using InfrastructureBase.Data;
using InfrastructureBase.Data.Aop.Filter;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Workflow.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class RedisController : ControllerBase
    {
        private readonly ICacheBase cacheBase;
        public RedisController(ICacheBase _cacheBase)
        {
            cacheBase = _cacheBase;
        }

        [HttpGet,Route("client")]
        [CacheFilter]
        public IActionResult GetRedisClient()
        {
            var client = this.cacheBase.GetRedisClient();
            return Ok(client.ClientGetName());
        }
    }
}
